DTS Transfer Structure Editor

This chapter describes the screen for defining the DTS transfer structure . Typically, the transfer structure contains all fields defined in the SAP repository and does not need to be changed. However, the transfer structure editor might be useful in the following cases:

  • Adding a virtual field. The virtual field helps to enrich DTS table structure to store information which is not available in the table directly. This field can be then used as a dependent field in the conversion phase. The virtual field is populated by DTS rule with rule usage Virtual field initialization.

  • Joining multiple tables connected at the application level. The joining function helps to enrich DTS table structure by the related fields from other table(s).

See an example at the end of this chapter.

You can change the transfer structure by clicking the button in the Transfer structure column in the step Maintain technical settings. After changing DTS structure definition, the step Store Table Structures must be executed.

NOTE Editing the transfer structure is only possible if the maintain technical settings screen is in edit mode.

The screen is split into two pages with the chosen table name in the header:

  • Table/join conditions: Defines the JOIN conditions.

  • View fields: Defines the fields required for the JOIN or a virtual field. The virtual field is an extension of the table structure and can be populated by a DTS rule.

NOTE For defining virtual fields, the table JOIN condition does not need to be filled.

The following options are available:

  • Save (Ctrl+S): Saves the setup (available in the edit mode).

  • Edit/display (Ctrl+F1): Switches between edit and save mode (available in edit mode).

  • Check (Ctrl+F2): Checks the consistency of the JOINs setup.

  • Delete (Shift+F1): Deletes the complete transfer structure setup (available in edit mode).

  • Display SELECT (F8): Displays the SELECT statement that will be used during the read tasks.

Table/join conditions: This page contains the JOIN definition to the chosen table and consists of two ALV grids:

  • Left-hand ALV grid with tables included in the JOIN and with the following columns:

    • Table name: Table name that will be involved in the JOIN to the selected table.

      NOTE Do not enter the table whose structure is being edited here.
    • Table alias: Table alias (optional).

    • Left join: Flag that sets the left JOIN. If disabled, the inner JOIN option is applied.

  • Right-hand ALV grid with fields that are connected via JOINs and with the following columns:

    • Table name: Left table name.

    • Table alias: Left table alias (optional).

    • Field name: Left table field.

    • Join operator: The only supported operator is the character = (direct assignment).

    • Table name: Right table name.

    • Table alias: Right table alias (optional).

    • Field name: Right table field.

View fields: This page defines the transfer structure of the table. It contains an ALV grid with the following columns:

  • Field name: Name of the field in the transfer structure.

    NOTE The wildcard character * adds all fields of the structure that are defined in the Table name column.
  • Table position: Number that defines the position of the field name (first column) in the transfer structure.

  • Table name: Table name to which the field name has a relation – either via a JOIN definition or as a virtual field data type definition.

  • Table alias: Table name alias. This parameter is optional and relevant only for tables involved in a JOIN.

  • Field name: Name of the field to which the field name (first column) has a relation – either via a JOIN definition or as a virtual field data type definition.

    NOTE If you used the wildcard character * in the first column, you must use it here as well.
  • Virtual flag: If enabled, the field name (first column) is considered as an additional field of the transfer structure. No JOIN operation needs to be defined for virtual fields. Instead, an initialization rule can be used. You can define the initialization rule in the step Maintain business objects.

    NOTE You must define a business object with the respective type before creating a rule and assigning it to a table.

Example of the transfer structure editor using made-up tables:

Data model definition
Table name Field name Type Comment
T1 A1 char5 T1 is the editing table
T1 B1 i  
T2 A2 char10  
T2 B2 i B2 stores values of B1
T2 C2 char2  

 

Table/JOIN condition - tables in JOIN
Table name Table alias Left JOIN
T2 TAB2  

 

Table/JOIN condition - connecting fields
Table name Table alias Field name JOIN operator Table name Table alias Field name
T1   B1 = T2 TAB2 B2

 

View fields - transfer structure definition
Field name Position Table name Table alias Field name Virtual
* 1 T1   *  
C2_FIELD 2 T2 TAB2 C2  
VIRT 3 T2   A2 X

 

The displayed select button will show the following statement for the setup above:

Copy
  TYPES:
    BEGIN OF ts_transfer_struct,
     A1         TYPE c LENGTH 5,
     B1         TYPE i,
     C2_FIELD   TYPE c LENGTH 8,
     VIRT     TYPE c LENGTH 10,
    END OF  ts_transfer_struct.

  DATA:
    gt_transfer_struct  TYPE TABLE OF ts_transfer_struct.
  
  SELECT T1~A1
       T1~B1
       TAB2~C2 AS C2_FIELD
  FROM T1
     INNER JOIN T2 AS TAB2
       ON T1~B1 = TAB2~B2
  INTO CORRESPONDING FIELDS OF TABLE gt_transfer_struct.